import { inject } from 'what-di';
import * as defaultConfig from "../config";
import { UedProvider } from "./UedProvider"; // 适配未引入新版cpaas-boot的情况

export function getEnvConfig() {
  try {
    var _config = inject('config') || {};

    return _config.config || defaultConfig;
  } catch (_unused) {
    return defaultConfig;
  }
}
/**
 * 获取dvaApp
 */

export function getDvaApp() {
  var dvaApp = inject('dvaApp');
  return dvaApp || window.dvaApp;
}
/**
 * 拓展配置
 * @param conf { Object }
 */

export function extendsEnvConfig(conf) {
  var _conf = inject('config');

  _conf.extends(conf);
}
export function registerUedContainer(Container) {
  var ued = inject(UedProvider);
  ued.registerContainer(Container);
}